/*
    DESCRIPTION HERE
 */

#include "led_effects.h"

int redPin = 12;          // LED connected to digital pin 12
int greenPin = 11;
int bluePin = 10;

int knobPin = 0;          // analog in pin for potentiometer
int photoPin = 2;         // analog in pin for switch
int photoState = 0;
int photoThreshold = 150; // threshold for enabling LEDs
int delayTime = 0;

int at = 1;               // start at on
int trigger = 0;          // function to run
int lastTrigger = 0;


// Set to 1 to enable serial debugging, be sure to set baud, too
int debug = 1;
int debug_baud = 9600;

/* END CONFIGURATION */

// Create LED_Effects instance and seed RNG
LED_Effects le(redPin, greenPin, bluePin);

void setup()
{                
  
  randomSeed(analogRead(5));
  Serial.begin(debug_baud);
  
}


// the loop() method runs over and over again,
// as long as the Arduino has power

void loop()                     
{

  photoState = analogRead(photoPin);
  delayTime = photoState;

  // select trigger
  trigger = 1;

  switch (trigger)
  {

  case 1:
    Serial.println("Trigger 1: downStep");
    le.downStep();
    break;

  case 2:
    Serial.println("Trigger 2: downUp");
    le.downUp();
    break;

  case 3:
    Serial.println("Trigger 3: upStep");
    le.upStep();
    break;

  case 4:
    Serial.println("Trigger 4: allBlink");
    le.allBlink();
    break;

  case 5:
    Serial.println("Trigger 5: scroll");
    le.scroll();
    break;

  case 6:
    Serial.println("Trigger 6: bounce");
    le.bounce();
    break;

  default:
    trigger = 0;
    break;

  }
  
  delay(delayTime);

}

